#include "QPSearch.h"

#include <QtGui>
#include <QApplication>
#include <QtDBus>
#include <QSystemDeviceInfo>

int main(int argc, char *argv[])
{
    if (!QDBusConnection::sessionBus().isConnected()) {
        qWarning("Cannot connect to the D-Bus session bus.");
        exit(1);
    }

    if (!QDBusConnection::sessionBus().registerService("com.nokia.qpsearch")) {
        qWarning("%s", qPrintable(QDBusConnection::sessionBus().lastError().
                                  message()));
        exit(2);
    }
/*
    // Qt 4.6.0 requires the following lines to access remote URLs.
#if QT_VERSION >= 0x040600
    QWebSettings* defaultSettings = QWebSettings::globalSettings();
    defaultSettings->setAttribute(
            QWebSettings::LocalContentCanAccessRemoteUrls, true);
#endif
*/
    Q_INIT_RESOURCE(icons);
    QApplication a(argc, argv);
    QPSearch w;
    //w.showMaximized();
    w.show();
    w.enterSearch();

    return a.exec();
}
